﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace ClassAdd
{
    class ModelClassDescription
    {
        public String nameClass;
        public String attribyteClass;
        public String nameSpace;
        public String usingList;
        public String variable;
        public String functionList;

        public void writeClass(string pathToWrite)
        {
            pathToWrite = pathToWrite + "\\Models\\" + nameClass + ".cs";
            String stringToWrite = "";
            stringToWrite = stringToWrite + usingList + "\n";
            stringToWrite = stringToWrite + "namespace " + nameSpace + "\n{\n";
            stringToWrite = stringToWrite + attribyteClass;
            stringToWrite = stringToWrite + "class " + nameClass + "Model" + "\n{\n";
            stringToWrite = stringToWrite + variable + "\n";
            stringToWrite = stringToWrite + functionList;
            stringToWrite = stringToWrite + "}\n}";

            try
            {
                File.WriteAllText(pathToWrite, stringToWrite);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
    }
}
